package com.feihong.activity.exception;

import com.feihong.activity.enums.CustomExceptionEnum;
import lombok.Data;

/**
 * 自定义异常，方便做处理
 * @author Filter
 */
@Data
public class CustomException extends RuntimeException{
    /**
     * 状态码
     */
    private String code;
    /**
     * 返回的信息
     */
    private String message;

    public CustomException(){

    }

    public CustomException(CustomExceptionEnum enums){
        this.code = enums.getCode();
        this.message = enums.getMsg();
    }

    public CustomException(String msg){
        this.code = "500";
        this.message = msg;
    }
}
